{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\logs\descriptive_stats_plots.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}19 May 2024, 20:21:14
{txt}
{com}. 
. ********************************************************************************
. ********************************** Table 1 *************************************
. ********************************************************************************
. use "$dr_temp\wrg_collapsed.dta", replace
{txt}
{com}. 
. *Declare panel structure of data
.         xtset WR_GROUP wua_year
{res}
{col 1}{txt:Panel variable: }{res:WR_GROUP}{txt: (unbalanced)}
{p 1 16 2}{txt:Time variable: }{res:wua_year}{txt:, }{res:{bind:1991}}{txt: to }{res:{bind:2019}}{txt:, but with gaps}{p_end}
{txt}{col 10}Delta: {res}1 unit
{txt}
{com}.         xtdescribe  /* There are 18,541 WR_GROUP's in this dataset only using wuadet_key records with IRR umw_code */

{txt}WR_GROUP:  {res}1{txt}, {res}3{txt}, ..., {res}21983                                  {txt}n ={res}      18541
{txt}wua_year:  {res}1991, 1992, ..., 2019                             {txt}T ={res}         29
           {txt}Delta(wua_year) = {res}1 unit
           {txt}Span(wua_year)  = {res}29 periods
           {txt}(WR_GROUP*wua_year uniquely identifies each observation)

Distribution of T_i:   min      5%     25%       50%       75%     95%     max
                    {res}     1       5      22        29        29      29      29

{txt}{col 6}Freq.  Percent    Cum. {c |}  Pattern
 {hline 27}{c +}{c -}{c -}{hline 29}
{res}     9985     53.85   53.85{txt} {c |}  {res}11111111111111111111111111111
      778      4.20   58.05{txt} {c |}  {res}11111........................
      197      1.06   59.11{txt} {c |}  {res}11111.11111111111111111111111
      176      0.95   60.06{txt} {c |}  {res}1111111111111111111111111111.
      132      0.71   60.77{txt} {c |}  {res}111111.......................
      129      0.70   61.47{txt} {c |}  {res}1............................
      121      0.65   62.12{txt} {c |}  {res}1111111.111111111111111111111
      118      0.64   62.76{txt} {c |}  {res}111111111.1111111111111111111
      100      0.54   63.30{txt} {c |}  {res}1111111111.111111111111111111
     6805     36.70  100.00{txt} {c |} (other patterns)
 {hline 27}{c +}{c -}{c -}{hline 29}
{res}    18541    100.00        {txt} {c |}  {res}XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{txt}
{com}. 
. /*Create a irrigation intensity outcome variable */
.         bysort WR_GROUP wua_year: gen depth_applied = af_used_irr/acres_irr
{txt}(12,834 missing values generated)

{com}.         
. /* Address missing and extreme values */
.         *Drop wr_groups who don't have predevelopment characteristics
.         keep if !missing(sy)
{txt}(70,993 observations deleted)

{com}.         keep if !missing(predev_sat)
{txt}(0 observations deleted)

{com}.         keep if !missing(predev_dtw)
{txt}(0 observations deleted)

{com}.         keep if !missing(hyd_cond)
{txt}(0 observations deleted)

{com}.         *Drop wr_groups if they have missing precip or soil data
.         drop if missing(jan_april_mean_ppt)
{txt}(0 observations deleted)

{com}.         drop if missing(awc)
{txt}(885 observations deleted)

{com}.         *Drop wr_groups if they have missing authorized quantities or acreage
.         drop if missing(wrg_authquant_IRR_umw) | missing(wrg_authquant_all_umw) | missing(wrg_auth_irr_acres)
{txt}(8,674 observations deleted)

{com}.         *Drop observations with recorded withdrawals but no irrigated acres and vice-versa
.         drop if af_used_irr>0 & acres_irr==0
{txt}(495 observations deleted)

{com}.         drop if acres_irr>0 & af_used_irr==0
{txt}(0 observations deleted)

{com}.         *Drop extreme values for af_used, acres_irr 
.                 sum af_used, d

                        {txt}(sum) af_used
{hline 61}
      Percentiles      Smallest
 1%    {res}        0              0
{txt} 5%    {res}       19              0
{txt}10%    {res}       44              0       {txt}Obs         {res}    363,631
{txt}25%    {res}       96              0       {txt}Sum of wgt. {res}    363,631

{txt}50%    {res}      161                      {txt}Mean          {res} 243.0458
                        {txt}Largest       Std. dev.     {res}  362.545
{txt}75%    {res}      264       15725.45
{txt}90%    {res}   500.84       16005.28       {txt}Variance      {res} 131438.9
{txt}95%    {res}      729       16191.03       {txt}Skewness      {res} 13.12807
{txt}99%    {res}  1431.82        18592.3       {txt}Kurtosis      {res} 365.9421
{txt}
{com}.                         drop if af_used >= r(p99) & af_used < .
{txt}(3,637 observations deleted)

{com}.                 sum acres_irr, d

                       {txt}(sum) acres_irr
{hline 61}
      Percentiles      Smallest
 1%    {res}        0              0
{txt} 5%    {res}       40              0
{txt}10%    {res}       73              0       {txt}Obs         {res}    359,994
{txt}25%    {res}      120              0       {txt}Sum of wgt. {res}    359,994

{txt}50%    {res}      130                      {txt}Mean          {res} 197.6613
                        {txt}Largest       Std. dev.     {res}   176.09
{txt}75%    {res}      240           3540
{txt}90%    {res}      390           3780       {txt}Variance      {res}  31007.7
{txt}95%    {res}      523           4000       {txt}Skewness      {res} 3.452098
{txt}99%    {res}      911           5120       {txt}Kurtosis      {res} 25.24593
{txt}
{com}.                         drop if acres_irr >= r(p99) & acres_irr < .
{txt}(3,605 observations deleted)

{com}.                 sum depth_applied, d

                        {txt}depth_applied
{hline 61}
      Percentiles      Smallest
 1%    {res}       .1        .000069
{txt} 5%    {res} .3129231       .0000769
{txt}10%    {res}     .472         .00008       {txt}Obs         {res}    350,366
{txt}25%    {res} .7586667       .0000833       {txt}Sum of wgt. {res}    350,366

{txt}50%    {res} 1.097462                      {txt}Mean          {res} 1.123839
                        {txt}Largest       Std. dev.     {res} .5311018
{txt}75%    {res} 1.449077          16.57
{txt}90%    {res} 1.799385         17.415       {txt}Variance      {res} .2820692
{txt}95%    {res}        2          27.87       {txt}Skewness      {res} 1.816609
{txt}99%    {res}    2.475          29.83       {txt}Kurtosis      {res} 57.22109
{txt}
{com}.                         drop if depth_applied >= r(p99) & depth_applied < .             
{txt}(3,513 observations deleted)

{com}.         *Change total precipitation and evapotranspiration variables to inches
.         foreach var of varlist total_preseason_ET0_elev total_growseason_ET0_elev ///
>                 total_preseason_ET0_Har total_growseason_ET0_Har total_preseason_ppt ///
>                 total_growseason_ppt {c -(}
{txt}  2{com}.                         replace `var' = `var'/25.4
{txt}  3{com}.                 {c )-}
{txt}(335,118 real changes made)
(335,118 real changes made)
(352,876 real changes made)
(352,876 real changes made)
(352,876 real changes made)
(352,876 real changes made)

{com}.         
. /* Label variables */
.         label var wua_year "Year"
{txt}
{com}.         label var af_used "Acre-feet applied"
{txt}
{com}.         label var acres_irr "Irrigated acres"
{txt}
{com}.         label var depth_applied "Depth applied - acre-feet applied per acre"
{txt}
{com}.         label var awc "Available water capacity"
{txt}
{com}.         label var sandtotal "Sand content (%)"
{txt}
{com}.         label var silttotal "Silt content (%)"
{txt}
{com}.         label var slope "Slope"
{txt}
{com}.         label var jan_april_mean_ppt "mean monthly preseason precipitation (mm)"
{txt}
{com}.         label var may_sep_mean_ppt "mean monthly growing season precipitation (mm)"
{txt}
{com}.         label var jan_april_mean_ET0_elev "mean daily preseason evapotranspiration, using elevation from ssurgo"
{txt}
{com}.         label var may_sep_mean_ET0_elev "mean daily growing season evapotranspiration, using elevation from ssurgo"
{txt}
{com}.         label var jan_april_mean_ET0_Har "mean daily preseason evapotranspiration"
{txt}
{com}.         label var may_sep_mean_ET0_Har "mean daily growing season evapotranspiration"
{txt}
{com}. 
. *Remove wr_groups with other technologies or with fractional data
. *for systems codes we're interested in *
.         drop if type_system_2 > 0 | type_system_5 > 0 | type_system_6 > 0 ///
>         | type_system_7 > 0 | type_system_8 > 0 | type_system_9 > 0
{txt}(37,437 observations deleted)

{com}.         *Drop fractional system_codes
.                 foreach var of varlist type_system_1 type_system_3 type_system_4 {c -(}
{txt}  2{com}.                         keep if `var'==1 | `var'==0
{txt}  3{com}.                 {c )-}
{txt}(5,491 observations deleted)
(1,919 observations deleted)
(0 observations deleted)

{com}. 
. *Check how many groups switch into each final system type multiple times
.         gen switch_flood_cp = l.type_system_1==1 & type_system_3==1
{txt}
{com}.                 by WR_GROUP: egen num_switch_flood_cp = total(switch_flood_cp)
{txt}
{com}.                 tab num_switch_flood_cp

{txt}num_switch_ {c |}
   flood_cp {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    280,921       91.20       91.20
{txt}          1 {c |}{res}     25,992        8.44       99.64
{txt}          2 {c |}{res}      1,104        0.36      100.00
{txt}          3 {c |}{res}         12        0.00      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen switch_flood_lepa = l.type_system_1==1 & type_system_4==1
{txt}
{com}.                 by WR_GROUP: egen num_switch_flood_lepa = total(switch_flood_lepa)
{txt}
{com}.                 tab num_switch_flood_lepa

{txt}num_switch_ {c |}
 flood_lepa {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    276,352       89.72       89.72
{txt}          1 {c |}{res}     30,195        9.80       99.52
{txt}          2 {c |}{res}      1,432        0.46       99.98
{txt}          3 {c |}{res}         50        0.02      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen switch_cp_lepa = l.type_system_3==1 & type_system_4==1
{txt}
{com}.                 by WR_GROUP: egen num_switch_cp_lepa = total(switch_cp_lepa)
{txt}
{com}.                 tab num_switch_cp_lepa

{txt}num_switch_ {c |}
    cp_lepa {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}     93,358       30.31       30.31
{txt}          1 {c |}{res}    131,349       42.64       72.95
{txt}          2 {c |}{res}     53,754       17.45       90.40
{txt}          3 {c |}{res}     19,214        6.24       96.64
{txt}          4 {c |}{res}      8,074        2.62       99.26
{txt}          5 {c |}{res}      1,584        0.51       99.77
{txt}          6 {c |}{res}        584        0.19       99.96
{txt}          7 {c |}{res}        112        0.04      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen switch_flood_cplepa = l.type_system_1==1 & type_system_3==1
{txt}
{com}.                 /* Also include those who switch from flood straight to LEPA */
.                 replace switch_flood_cplepa = 1 if l.type_system_1==1 & type_system_4==1
{txt}(1,324 real changes made)

{com}.                 by WR_GROUP: egen num_switch_flood_cplepa = total(switch_flood_cplepa)
{txt}
{com}.                 tab num_switch_flood_cplepa

{txt}num_switch_ {c |}
flood_cplep {c |}
          a {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    251,224       81.56       81.56
{txt}          1 {c |}{res}     52,439       17.02       98.58
{txt}          2 {c |}{res}      4,147        1.35       99.93
{txt}          3 {c |}{res}        164        0.05       99.98
{txt}          4 {c |}{res}         55        0.02      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}. 
. *Create variables showing reversion from one to another, and how many times they revert
.         gen reversion_cp_flood = l.type_system_3==1 & type_system_1==1
{txt}
{com}.                 by WR_GROUP: egen num_revers_cp_flood = total(reversion_cp_flood)
{txt}
{com}.                 tab num_revers_cp_flood

{txt}num_revers_ {c |}
   cp_flood {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    299,089       97.10       97.10
{txt}          1 {c |}{res}      8,619        2.80       99.90
{txt}          2 {c |}{res}        321        0.10      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen reversion_lepa_flood = l.type_system_4==1 & type_system_1==1
{txt}
{com}.                 by WR_GROUP: egen num_revers_lepa_flood = total(reversion_lepa_flood)
{txt}
{com}.                 tab num_revers_lepa_flood

{txt}num_revers_ {c |}
 lepa_flood {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    300,036       97.41       97.41
{txt}          1 {c |}{res}      7,711        2.50       99.91
{txt}          2 {c |}{res}        282        0.09      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen reversion_lepa_cp = l.type_system_4==1 & type_system_3==1
{txt}
{com}.                 by WR_GROUP: egen num_revers_lepa_cp = total(reversion_lepa_cp)
{txt}
{com}.                 tab num_revers_lepa_cp

{txt}num_revers_ {c |}
    lepa_cp {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    193,997       62.98       62.98
{txt}          1 {c |}{res}     73,024       23.71       86.69
{txt}          2 {c |}{res}     27,200        8.83       95.52
{txt}          3 {c |}{res}     10,085        3.27       98.79
{txt}          4 {c |}{res}      2,884        0.94       99.73
{txt}          5 {c |}{res}        585        0.19       99.92
{txt}          6 {c |}{res}        254        0.08      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}.         gen reversion_cplepa_flood = l.type_system_3==1 & type_system_1==1
{txt}
{com}.                 replace reversion_cplepa_flood = 1 if l.type_system_4==1 & type_system_1==1
{txt}(336 real changes made)

{com}.                 by WR_GROUP: egen num_revers_cplepa_flood = total(reversion_cplepa_flood)
{txt}
{com}.                 tab num_revers_cplepa_flood

{txt}num_revers_ {c |}
cplepa_floo {c |}
          d {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}    291,661       94.69       94.69
{txt}          1 {c |}{res}     15,310        4.97       99.66
{txt}          2 {c |}{res}        975        0.32       99.97
{txt}          3 {c |}{res}         56        0.02       99.99
{txt}          4 {c |}{res}         27        0.01      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}    308,029      100.00
{txt}
{com}. 
. *Drop multiple switchers or reverters
.         drop if num_switch_flood_cp>=2
{txt}(1,116 observations deleted)

{com}.         drop if num_revers_cp_flood>=1
{txt}(7,908 observations deleted)

{com}.         drop if num_switch_flood_lepa>=2
{txt}(1,257 observations deleted)

{com}.         drop if num_revers_lepa_flood>=1
{txt}(6,291 observations deleted)

{com}.         drop if num_switch_cp_lepa>=2
{txt}(79,318 observations deleted)

{com}.         drop if num_revers_lepa_cp>=1
{txt}(31,009 observations deleted)

{com}.         drop if num_switch_flood_cplepa>=2
{txt}(78 observations deleted)

{com}.         drop if num_revers_cplepa_flood>=1
{txt}(0 observations deleted)

{com}.                 
. *Create variable with gmd number
.         gen gmd = 0
{txt}
{com}.         forvalues i=1(1)5 {c -(}
{txt}  2{com}.                 replace gmd = `i' if gmd_`i'==1
{txt}  3{com}.         {c )-}
{txt}(12,965 real changes made)
(15,462 real changes made)
(59,540 real changes made)
(29,146 real changes made)
(52,016 real changes made)

{com}.         
. eststo clear
{txt}
{com}. 
. *Create table of summary statistics for all transitions
. estpost summarize af_used af_used_irr acres_irr depth_applied ///
>         sandtotal silttotal awc ///
>         sy predev_dtw predev_sat hyd_cond /// 
>         total_preseason_ET0_elev total_growseason_ET0_elev ///
>         total_preseason_ppt total_growseason_ppt, d

{txt}{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(count)}{space 1}{space 1}{ralign 9:e(sum_w)}{space 1}{space 1}{ralign 9:e(mean)}{space 1}{space 1}{ralign 9:e(Var)}{space 1}{space 1}{ralign 9:e(sd)}{space 1}{space 1}{ralign 9:e(skewn~)}{space 1}{space 1}{ralign 9:e(kurto~)}{space 1}{space 1}{ralign 9:e(sum)}{space 1}{space 1}{ralign 9:e(min)}{space 1}{space 1}{ralign 9:e(max)}{space 1}{space 1}{ralign 9:e(p1)}{space 1}{space 1}{ralign 9:e(p5)}{space 1}{space 1}{ralign 9:e(p10)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 208.0617}}}{space 1}{space 1}{ralign 9:{res:{sf: 36170.11}}}{space 1}{space 1}{ralign 9:{res:{sf: 190.1844}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.384296}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.27736}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.77e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:     1431}}}{space 1}{space 1}{ralign 9:{res:{sf:     5.99}}}{space 1}{space 1}{ralign 9:{res:{sf:    26.52}}}{space 1}{space 1}{ralign 9:{res:{sf:    47.68}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 208.0617}}}{space 1}{space 1}{ralign 9:{res:{sf: 36170.11}}}{space 1}{space 1}{ralign 9:{res:{sf: 190.1844}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.384296}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.27736}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.77e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:     1431}}}{space 1}{space 1}{ralign 9:{res:{sf:     5.99}}}{space 1}{space 1}{ralign 9:{res:{sf:    26.52}}}{space 1}{space 1}{ralign 9:{res:{sf:    47.68}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 185.0086}}}{space 1}{space 1}{ralign 9:{res:{sf: 19049.67}}}{space 1}{space 1}{ralign 9:{res:{sf: 138.0205}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.158799}}}{space 1}{space 1}{ralign 9:{res:{sf: 8.254197}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.35e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:        1}}}{space 1}{space 1}{ralign 9:{res:{sf:      910}}}{space 1}{space 1}{ralign 9:{res:{sf:       20}}}{space 1}{space 1}{ralign 9:{res:{sf:       50}}}{space 1}{space 1}{ralign 9:{res:{sf:       75}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.110173}}}{space 1}{space 1}{ralign 9:{res:{sf: .2389477}}}{space 1}{space 1}{ralign 9:{res:{sf: .4888227}}}{space 1}{space 1}{ralign 9:{res:{sf: .1478645}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.595056}}}{space 1}{space 1}{ralign 9:{res:{sf: 200999.1}}}{space 1}{space 1}{ralign 9:{res:{sf: .0000769}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.474919}}}{space 1}{space 1}{ralign 9:{res:{sf:       .1}}}{space 1}{space 1}{ralign 9:{res:{sf: .3140476}}}{space 1}{space 1}{ralign 9:{res:{sf:     .472}}}{space 1}
{space 0}{space 0}{ralign 12:sandtotal}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 36.16925}}}{space 1}{space 1}{ralign 9:{res:{sf: 791.5038}}}{space 1}{space 1}{ralign 9:{res:{sf: 28.13368}}}{space 1}{space 1}{ralign 9:{res:{sf: .6314734}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.864084}}}{space 1}{space 1}{ralign 9:{res:{sf:  6548515}}}{space 1}{space 1}{ralign 9:{res:{sf: 5.231788}}}{space 1}{space 1}{ralign 9:{res:{sf: 97.35431}}}{space 1}{space 1}{ralign 9:{res:{sf: 5.231788}}}{space 1}{space 1}{ralign 9:{res:{sf: 6.187011}}}{space 1}{space 1}{ralign 9:{res:{sf: 6.401624}}}{space 1}
{space 0}{space 0}{ralign 12:silttotal}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 41.62658}}}{space 1}{space 1}{ralign 9:{res:{sf: 460.7399}}}{space 1}{space 1}{ralign 9:{res:{sf: 21.46485}}}{space 1}{space 1}{ralign 9:{res:{sf:-.3622663}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.616931}}}{space 1}{space 1}{ralign 9:{res:{sf:  7536575}}}{space 1}{space 1}{ralign 9:{res:{sf:       .6}}}{space 1}{space 1}{ralign 9:{res:{sf: 71.10861}}}{space 1}{space 1}{ralign 9:{res:{sf: .6304636}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.160412}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.182252}}}{space 1}
{space 0}{space 0}{ralign 12:awc}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: .1683774}}}{space 1}{space 1}{ralign 9:{res:{sf: .0017977}}}{space 1}{space 1}{ralign 9:{res:{sf: .0423996}}}{space 1}{space 1}{ralign 9:{res:{sf:-.6010956}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.198454}}}{space 1}{space 1}{ralign 9:{res:{sf: 30485.07}}}{space 1}{space 1}{ralign 9:{res:{sf:      .05}}}{space 1}{space 1}{ralign 9:{res:{sf: .2234437}}}{space 1}{space 1}{ralign 9:{res:{sf: .0539735}}}{space 1}{space 1}{ralign 9:{res:{sf: .0950118}}}{space 1}{space 1}{ralign 9:{res:{sf: .1022884}}}{space 1}
{space 0}{space 0}{ralign 12:sy}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 16.74934}}}{space 1}{space 1}{ralign 9:{res:{sf: 14.88049}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.857523}}}{space 1}{space 1}{ralign 9:{res:{sf:-1.084685}}}{space 1}{space 1}{ralign 9:{res:{sf: 6.164092}}}{space 1}{space 1}{ralign 9:{res:{sf:  3032501}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:       25}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:       10}}}{space 1}{space 1}{ralign 9:{res:{sf:       12}}}{space 1}
{space 0}{space 0}{ralign 12:predev_dtw}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 65.42884}}}{space 1}{space 1}{ralign 9:{res:{sf: 3149.805}}}{space 1}{space 1}{ralign 9:{res:{sf: 56.12312}}}{space 1}{space 1}{ralign 9:{res:{sf: .6884021}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.570271}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.18e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf: 260.1899}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}
{space 0}{space 0}{ralign 12:predev_sat}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 153.6365}}}{space 1}{space 1}{ralign 9:{res:{sf: 12977.59}}}{space 1}{space 1}{ralign 9:{res:{sf: 113.9192}}}{space 1}{space 1}{ralign 9:{res:{sf:  .944573}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.684921}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.78e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:-.1600342}}}{space 1}{space 1}{ralign 9:{res:{sf:   610.38}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}
{space 0}{space 0}{ralign 12:hyd_cond}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 82.09502}}}{space 1}{space 1}{ralign 9:{res:{sf: 677.4451}}}{space 1}{space 1}{ralign 9:{res:{sf: 26.02778}}}{space 1}{space 1}{ralign 9:{res:{sf:-.8420914}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.513477}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.49e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:        0}}}{space 1}{space 1}{ralign 9:{res:{sf:      135}}}{space 1}{space 1}{ralign 9:{res:{sf:       19}}}{space 1}{space 1}{ralign 9:{res:{sf:       34}}}{space 1}{space 1}{ralign 9:{res:{sf:       45}}}{space 1}
{space 0}{space 0}{ralign 12:total_pres~v}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   172125}}}{space 1}{space 1}{ralign 9:{res:{sf:   172125}}}{space 1}{space 1}{ralign 9:{res:{sf: 14.29444}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.997658}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.413385}}}{space 1}{space 1}{ralign 9:{res:{sf:-.1827386}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.894669}}}{space 1}{space 1}{ralign 9:{res:{sf:  2460430}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.537498}}}{space 1}{space 1}{ralign 9:{res:{sf: 18.29114}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.73786}}}{space 1}{space 1}{ralign 9:{res:{sf: 11.95241}}}{space 1}{space 1}{ralign 9:{res:{sf: 12.48895}}}{space 1}
{space 0}{space 0}{ralign 12:total_grow~v}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   172125}}}{space 1}{space 1}{ralign 9:{res:{sf:   172125}}}{space 1}{space 1}{ralign 9:{res:{sf: 28.92822}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.987664}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.728486}}}{space 1}{space 1}{ralign 9:{res:{sf: .2587619}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.863148}}}{space 1}{space 1}{ralign 9:{res:{sf:  4979269}}}{space 1}{space 1}{ralign 9:{res:{sf: 24.49811}}}{space 1}{space 1}{ralign 9:{res:{sf: 34.58674}}}{space 1}{space 1}{ralign 9:{res:{sf: 25.37223}}}{space 1}{space 1}{ralign 9:{res:{sf:   26.274}}}{space 1}{space 1}{ralign 9:{res:{sf: 26.74279}}}{space 1}
{space 0}{space 0}{ralign 12:total_pres~t}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 4.794581}}}{space 1}{space 1}{ralign 9:{res:{sf: 6.062893}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.462294}}}{space 1}{space 1}{ralign 9:{res:{sf: .9014438}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.604967}}}{space 1}{space 1}{ralign 9:{res:{sf: 868068.5}}}{space 1}{space 1}{ralign 9:{res:{sf:  .327126}}}{space 1}{space 1}{ralign 9:{res:{sf: 15.19732}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.117391}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.635518}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.027607}}}{space 1}
{space 0}{space 0}{ralign 12:total_grow~t}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf:   181052}}}{space 1}{space 1}{ralign 9:{res:{sf: 15.36717}}}{space 1}{space 1}{ralign 9:{res:{sf: 26.82506}}}{space 1}{space 1}{ralign 9:{res:{sf: 5.179291}}}{space 1}{space 1}{ralign 9:{res:{sf: .5274144}}}{space 1}{space 1}{ralign 9:{res:{sf: 3.244005}}}{space 1}{space 1}{ralign 9:{res:{sf:  2782258}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.617608}}}{space 1}{space 1}{ralign 9:{res:{sf: 38.67468}}}{space 1}{space 1}{ralign 9:{res:{sf: 5.422992}}}{space 1}{space 1}{ralign 9:{res:{sf: 7.623772}}}{space 1}{space 1}{ralign 9:{res:{sf:  9.24996}}}{space 1}

{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(p25)}{space 1}{space 1}{ralign 9:e(p50)}{space 1}{space 1}{ralign 9:e(p75)}{space 1}{space 1}{ralign 9:e(p90)}{space 1}{space 1}{ralign 9:e(p95)}{space 1}{space 1}{ralign 9:e(p99)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    95.01}}}{space 1}{space 1}{ralign 9:{res:{sf:   156.67}}}{space 1}{space 1}{ralign 9:{res:{sf:   243.32}}}{space 1}{space 1}{ralign 9:{res:{sf:      439}}}{space 1}{space 1}{ralign 9:{res:{sf:   602.18}}}{space 1}{space 1}{ralign 9:{res:{sf:      983}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    95.01}}}{space 1}{space 1}{ralign 9:{res:{sf:   156.67}}}{space 1}{space 1}{ralign 9:{res:{sf:   243.32}}}{space 1}{space 1}{ralign 9:{res:{sf:      439}}}{space 1}{space 1}{ralign 9:{res:{sf:   602.18}}}{space 1}{space 1}{ralign 9:{res:{sf:      983}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      120}}}{space 1}{space 1}{ralign 9:{res:{sf:      130}}}{space 1}{space 1}{ralign 9:{res:{sf:      240}}}{space 1}{space 1}{ralign 9:{res:{sf:      365}}}{space 1}{space 1}{ralign 9:{res:{sf:      498}}}{space 1}{space 1}{ralign 9:{res:{sf:      732}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      .76}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.098174}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.443015}}}{space 1}{space 1}{ralign 9:{res:{sf:  1.77075}}}{space 1}{space 1}{ralign 9:{res:{sf:   1.9625}}}{space 1}{space 1}{ralign 9:{res:{sf:  2.25024}}}{space 1}
{space 0}{space 0}{ralign 12:sandtotal}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 12.50801}}}{space 1}{space 1}{ralign 9:{res:{sf: 19.68003}}}{space 1}{space 1}{ralign 9:{res:{sf:     63.5}}}{space 1}{space 1}{ralign 9:{res:{sf: 83.64937}}}{space 1}{space 1}{ralign 9:{res:{sf: 84.10596}}}{space 1}{space 1}{ralign 9:{res:{sf: 94.47874}}}{space 1}
{space 0}{space 0}{ralign 12:silttotal}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 21.39073}}}{space 1}{space 1}{ralign 9:{res:{sf: 51.66385}}}{space 1}{space 1}{ralign 9:{res:{sf: 61.24768}}}{space 1}{space 1}{ralign 9:{res:{sf:   67.149}}}{space 1}{space 1}{ralign 9:{res:{sf: 67.81986}}}{space 1}{space 1}{ralign 9:{res:{sf: 68.03311}}}{space 1}
{space 0}{space 0}{ralign 12:awc}{space 1}{c |}{space 1}{ralign 9:{res:{sf: .1355408}}}{space 1}{space 1}{ralign 9:{res:{sf: .1820023}}}{space 1}{space 1}{ralign 9:{res:{sf: .2076993}}}{space 1}{space 1}{ralign 9:{res:{sf: .2122189}}}{space 1}{space 1}{ralign 9:{res:{sf:  .214702}}}{space 1}{space 1}{ralign 9:{res:{sf: .2234437}}}{space 1}
{space 0}{space 0}{ralign 12:sy}{space 1}{c |}{space 1}{ralign 9:{res:{sf:       15}}}{space 1}{space 1}{ralign 9:{res:{sf:       17}}}{space 1}{space 1}{ralign 9:{res:{sf:       20}}}{space 1}{space 1}{ralign 9:{res:{sf:       20}}}{space 1}{space 1}{ralign 9:{res:{sf:       21}}}{space 1}{space 1}{ralign 9:{res:{sf:       25}}}{space 1}
{space 0}{space 0}{ralign 12:predev_dtw}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 16.68005}}}{space 1}{space 1}{ralign 9:{res:{sf: 53.98999}}}{space 1}{space 1}{ralign 9:{res:{sf: 106.1599}}}{space 1}{space 1}{ralign 9:{res:{sf: 145.2034}}}{space 1}{space 1}{ralign 9:{res:{sf:   173.28}}}{space 1}{space 1}{ralign 9:{res:{sf: 208.5601}}}{space 1}
{space 0}{space 0}{ralign 12:predev_sat}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 79.76001}}}{space 1}{space 1}{ralign 9:{res:{sf:      131}}}{space 1}{space 1}{ralign 9:{res:{sf:    195.9}}}{space 1}{space 1}{ralign 9:{res:{sf: 331.6499}}}{space 1}{space 1}{ralign 9:{res:{sf: 370.4199}}}{space 1}{space 1}{ralign 9:{res:{sf: 499.1899}}}{space 1}
{space 0}{space 0}{ralign 12:hyd_cond}{space 1}{c |}{space 1}{ralign 9:{res:{sf:       57}}}{space 1}{space 1}{ralign 9:{res:{sf:       97}}}{space 1}{space 1}{ralign 9:{res:{sf:      101}}}{space 1}{space 1}{ralign 9:{res:{sf:      106}}}{space 1}{space 1}{ralign 9:{res:{sf:      109}}}{space 1}{space 1}{ralign 9:{res:{sf:      114}}}{space 1}
{space 0}{space 0}{ralign 12:total_pres~v}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 13.35268}}}{space 1}{space 1}{ralign 9:{res:{sf: 14.34714}}}{space 1}{space 1}{ralign 9:{res:{sf: 15.27307}}}{space 1}{space 1}{ralign 9:{res:{sf: 16.10192}}}{space 1}{space 1}{ralign 9:{res:{sf: 16.62373}}}{space 1}{space 1}{ralign 9:{res:{sf:  17.2402}}}{space 1}
{space 0}{space 0}{ralign 12:total_grow~v}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 27.61216}}}{space 1}{space 1}{ralign 9:{res:{sf: 28.92903}}}{space 1}{space 1}{ralign 9:{res:{sf: 30.06942}}}{space 1}{space 1}{ralign 9:{res:{sf: 31.08649}}}{space 1}{space 1}{ralign 9:{res:{sf: 31.87272}}}{space 1}{space 1}{ralign 9:{res:{sf: 33.42862}}}{space 1}
{space 0}{space 0}{ralign 12:total_pres~t}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 2.949252}}}{space 1}{space 1}{ralign 9:{res:{sf: 4.298535}}}{space 1}{space 1}{ralign 9:{res:{sf:  6.24311}}}{space 1}{space 1}{ralign 9:{res:{sf:  8.18689}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.727381}}}{space 1}{space 1}{ralign 9:{res:{sf: 11.96157}}}{space 1}
{space 0}{space 0}{ralign 12:total_grow~t}{space 1}{c |}{space 1}{ralign 9:{res:{sf: 11.69856}}}{space 1}{space 1}{ralign 9:{res:{sf: 14.72974}}}{space 1}{space 1}{ralign 9:{res:{sf: 18.67175}}}{space 1}{space 1}{ralign 9:{res:{sf: 22.37598}}}{space 1}{space 1}{ralign 9:{res:{sf: 24.62157}}}{space 1}{space 1}{ralign 9:{res:{sf:   29.144}}}{space 1}

{com}. esttab . using "$dr_output_main/table1_wrg_alltech_sum_stats.rtf" , cells("mean(fmt(%9.2fc)) p50(fmt(%9.2fc)) sd min max") title("Table 1: Summary Statistics") nomtitles label replace wide 
{res}{txt}(output written to {browse  `"C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/table1_wrg_alltech_sum_stats.rtf"'})

{com}. 
. *Now make tables for each technology separately
.         *Start with flood 
.         preserve
{txt}
{com}.         keep if type_system_1==1
{txt}(146,576 observations deleted)

{com}.         estpost summarize af_used af_used_irr acres_irr depth_applied, d

{txt}{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(count)}{space 1}{space 1}{ralign 9:e(sum_w)}{space 1}{space 1}{ralign 9:e(mean)}{space 1}{space 1}{ralign 9:e(Var)}{space 1}{space 1}{ralign 9:e(sd)}{space 1}{space 1}{ralign 9:e(skewn~)}{space 1}{space 1}{ralign 9:e(kurto~)}{space 1}{space 1}{ralign 9:e(sum)}{space 1}{space 1}{ralign 9:e(min)}{space 1}{space 1}{ralign 9:e(max)}{space 1}{space 1}{ralign 9:e(p1)}{space 1}{space 1}{ralign 9:e(p5)}{space 1}{space 1}{ralign 9:e(p10)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf: 178.6943}}}{space 1}{space 1}{ralign 9:{res:{sf: 41969.51}}}{space 1}{space 1}{ralign 9:{res:{sf: 204.8646}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.438153}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.33454}}}{space 1}{space 1}{ralign 9:{res:{sf:  6160666}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:  1426.96}}}{space 1}{space 1}{ralign 9:{res:{sf:     1.38}}}{space 1}{space 1}{ralign 9:{res:{sf:       10}}}{space 1}{space 1}{ralign 9:{res:{sf:    20.25}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf: 178.6943}}}{space 1}{space 1}{ralign 9:{res:{sf: 41969.51}}}{space 1}{space 1}{ralign 9:{res:{sf: 204.8646}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.438153}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.33454}}}{space 1}{space 1}{ralign 9:{res:{sf:  6160666}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:  1426.96}}}{space 1}{space 1}{ralign 9:{res:{sf:     1.38}}}{space 1}{space 1}{ralign 9:{res:{sf:       10}}}{space 1}{space 1}{ralign 9:{res:{sf:    20.25}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf: 152.9802}}}{space 1}{space 1}{ralign 9:{res:{sf: 20419.52}}}{space 1}{space 1}{ralign 9:{res:{sf: 142.8969}}}{space 1}{space 1}{ralign 9:{res:{sf:  2.04238}}}{space 1}{space 1}{ralign 9:{res:{sf: 7.726971}}}{space 1}{space 1}{ralign 9:{res:{sf:  5274147}}}{space 1}{space 1}{ralign 9:{res:{sf:        1}}}{space 1}{space 1}{ralign 9:{res:{sf:      910}}}{space 1}{space 1}{ralign 9:{res:{sf:        6}}}{space 1}{space 1}{ralign 9:{res:{sf:       20}}}{space 1}{space 1}{ralign 9:{res:{sf:       34}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf:    34476}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.116412}}}{space 1}{space 1}{ralign 9:{res:{sf: .3115891}}}{space 1}{space 1}{ralign 9:{res:{sf: .5582017}}}{space 1}{space 1}{ralign 9:{res:{sf: .1933644}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.278575}}}{space 1}{space 1}{ralign 9:{res:{sf: 38489.43}}}{space 1}{space 1}{ralign 9:{res:{sf: .0001695}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.474919}}}{space 1}{space 1}{ralign 9:{res:{sf:      .07}}}{space 1}{space 1}{ralign 9:{res:{sf: .2466013}}}{space 1}{space 1}{ralign 9:{res:{sf: .3912359}}}{space 1}

{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(p25)}{space 1}{space 1}{ralign 9:e(p50)}{space 1}{space 1}{ralign 9:e(p75)}{space 1}{space 1}{ralign 9:e(p90)}{space 1}{space 1}{ralign 9:e(p95)}{space 1}{space 1}{ralign 9:e(p99)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    49.72}}}{space 1}{space 1}{ralign 9:{res:{sf:  107.895}}}{space 1}{space 1}{ralign 9:{res:{sf:      230}}}{space 1}{space 1}{ralign 9:{res:{sf:      422}}}{space 1}{space 1}{ralign 9:{res:{sf:      604}}}{space 1}{space 1}{ralign 9:{res:{sf:  1045.88}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    49.72}}}{space 1}{space 1}{ralign 9:{res:{sf:  107.895}}}{space 1}{space 1}{ralign 9:{res:{sf:      230}}}{space 1}{space 1}{ralign 9:{res:{sf:      422}}}{space 1}{space 1}{ralign 9:{res:{sf:      604}}}{space 1}{space 1}{ralign 9:{res:{sf:  1045.88}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:       60}}}{space 1}{space 1}{ralign 9:{res:{sf:      111}}}{space 1}{space 1}{ralign 9:{res:{sf:      175}}}{space 1}{space 1}{ralign 9:{res:{sf:      320}}}{space 1}{space 1}{ralign 9:{res:{sf:      473}}}{space 1}{space 1}{ralign 9:{res:{sf:      670}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf: .6839367}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.083549}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.514163}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.908497}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.066846}}}{space 1}{space 1}{ralign 9:{res:{sf:     2.35}}}{space 1}

{com}.         esttab . using "$dr_output_main/table1_wrg_flood_sum_stats.rtf" , cells("mean(fmt(%9.2fc)) p50(fmt(%9.2fc)) sd min max") title("Table 1: Flood Summary Statistics") nomtitles label replace wide 
{res}{txt}(output written to {browse  `"C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/table1_wrg_flood_sum_stats.rtf"'})

{com}.         restore 
{txt}
{com}. 
.         *Now center-pivot
.         preserve
{txt}
{com}.         keep if type_system_3==1
{txt}(144,820 observations deleted)

{com}.         estpost summarize af_used af_used_irr acres_irr depth_applied, d

{txt}{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(count)}{space 1}{space 1}{ralign 9:e(sum_w)}{space 1}{space 1}{ralign 9:e(mean)}{space 1}{space 1}{ralign 9:e(Var)}{space 1}{space 1}{ralign 9:e(sd)}{space 1}{space 1}{ralign 9:e(skewn~)}{space 1}{space 1}{ralign 9:e(kurto~)}{space 1}{space 1}{ralign 9:e(sum)}{space 1}{space 1}{ralign 9:e(min)}{space 1}{space 1}{ralign 9:e(max)}{space 1}{space 1}{ralign 9:e(p1)}{space 1}{space 1}{ralign 9:e(p5)}{space 1}{space 1}{ralign 9:e(p10)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf: 201.5984}}}{space 1}{space 1}{ralign 9:{res:{sf: 32774.78}}}{space 1}{space 1}{ralign 9:{res:{sf: 181.0381}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.652845}}}{space 1}{space 1}{ralign 9:{res:{sf: 11.96168}}}{space 1}{space 1}{ralign 9:{res:{sf:  7304312}}}{space 1}{space 1}{ralign 9:{res:{sf:      .02}}}{space 1}{space 1}{ralign 9:{res:{sf:  1427.24}}}{space 1}{space 1}{ralign 9:{res:{sf:        9}}}{space 1}{space 1}{ralign 9:{res:{sf:    33.22}}}{space 1}{space 1}{ralign 9:{res:{sf:       56}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf: 201.5984}}}{space 1}{space 1}{ralign 9:{res:{sf: 32774.78}}}{space 1}{space 1}{ralign 9:{res:{sf: 181.0381}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.652845}}}{space 1}{space 1}{ralign 9:{res:{sf: 11.96168}}}{space 1}{space 1}{ralign 9:{res:{sf:  7304312}}}{space 1}{space 1}{ralign 9:{res:{sf:      .02}}}{space 1}{space 1}{ralign 9:{res:{sf:  1427.24}}}{space 1}{space 1}{ralign 9:{res:{sf:        9}}}{space 1}{space 1}{ralign 9:{res:{sf:    33.22}}}{space 1}{space 1}{ralign 9:{res:{sf:       56}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf: 179.4189}}}{space 1}{space 1}{ralign 9:{res:{sf: 15317.01}}}{space 1}{space 1}{ralign 9:{res:{sf: 123.7619}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.662919}}}{space 1}{space 1}{ralign 9:{res:{sf: 10.95043}}}{space 1}{space 1}{ralign 9:{res:{sf:  6500706}}}{space 1}{space 1}{ralign 9:{res:{sf:        4}}}{space 1}{space 1}{ralign 9:{res:{sf:      910}}}{space 1}{space 1}{ralign 9:{res:{sf:       42}}}{space 1}{space 1}{ralign 9:{res:{sf:       86}}}{space 1}{space 1}{ralign 9:{res:{sf:      115}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf:    36232}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.098272}}}{space 1}{space 1}{ralign 9:{res:{sf: .2415283}}}{space 1}{space 1}{ralign 9:{res:{sf: .4914553}}}{space 1}{space 1}{ralign 9:{res:{sf: .1148934}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.535104}}}{space 1}{space 1}{ralign 9:{res:{sf:  39792.6}}}{space 1}{space 1}{ralign 9:{res:{sf:  .000125}}}{space 1}{space 1}{ralign 9:{res:{sf:  2.47476}}}{space 1}{space 1}{ralign 9:{res:{sf: .0925197}}}{space 1}{space 1}{ralign 9:{res:{sf:  .287069}}}{space 1}{space 1}{ralign 9:{res:{sf: .4506667}}}{space 1}

{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(p25)}{space 1}{space 1}{ralign 9:e(p50)}{space 1}{space 1}{ralign 9:e(p75)}{space 1}{space 1}{ralign 9:e(p90)}{space 1}{space 1}{ralign 9:e(p95)}{space 1}{space 1}{ralign 9:e(p99)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   100.58}}}{space 1}{space 1}{ralign 9:{res:{sf:  155.585}}}{space 1}{space 1}{ralign 9:{res:{sf:  226.305}}}{space 1}{space 1}{ralign 9:{res:{sf:      404}}}{space 1}{space 1}{ralign 9:{res:{sf:   574.74}}}{space 1}{space 1}{ralign 9:{res:{sf:      976}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   100.58}}}{space 1}{space 1}{ralign 9:{res:{sf:  155.585}}}{space 1}{space 1}{ralign 9:{res:{sf:  226.305}}}{space 1}{space 1}{ralign 9:{res:{sf:      404}}}{space 1}{space 1}{ralign 9:{res:{sf:   574.74}}}{space 1}{space 1}{ralign 9:{res:{sf:      976}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      125}}}{space 1}{space 1}{ralign 9:{res:{sf:      130}}}{space 1}{space 1}{ralign 9:{res:{sf:      189}}}{space 1}{space 1}{ralign 9:{res:{sf:      310}}}{space 1}{space 1}{ralign 9:{res:{sf:      480}}}{space 1}{space 1}{ralign 9:{res:{sf:      726}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf: .7461538}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.087287}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.441043}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.755844}}}{space 1}{space 1}{ralign 9:{res:{sf:   1.9516}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.217196}}}{space 1}

{com}.         esttab . using "$dr_output_main/table1_wrg_cp_sum_stats.rtf" , cells("mean(fmt(%9.2fc)) p50(fmt(%9.2fc)) sd min max") title("Table 1: Center-pivot Summary Statistics") nomtitles label replace wide 
{res}{txt}(output written to {browse  `"C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/table1_wrg_cp_sum_stats.rtf"'})

{com}.         restore 
{txt}
{com}.         
.         *Now LEPA
.         preserve
{txt}
{com}.         keep if type_system_4==1
{txt}(70,708 observations deleted)

{com}.         estpost summarize af_used af_used_irr acres_irr depth_applied, d

{txt}{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(count)}{space 1}{space 1}{ralign 9:e(sum_w)}{space 1}{space 1}{ralign 9:e(mean)}{space 1}{space 1}{ralign 9:e(Var)}{space 1}{space 1}{ralign 9:e(sd)}{space 1}{space 1}{ralign 9:e(skewn~)}{space 1}{space 1}{ralign 9:e(kurto~)}{space 1}{space 1}{ralign 9:e(sum)}{space 1}{space 1}{ralign 9:e(min)}{space 1}{space 1}{ralign 9:e(max)}{space 1}{space 1}{ralign 9:e(p1)}{space 1}{space 1}{ralign 9:e(p5)}{space 1}{space 1}{ralign 9:e(p10)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf: 219.3595}}}{space 1}{space 1}{ralign 9:{res:{sf: 35062.85}}}{space 1}{space 1}{ralign 9:{res:{sf: 187.2508}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.341896}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.977149}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.42e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:     1431}}}{space 1}{space 1}{ralign 9:{res:{sf:    11.89}}}{space 1}{space 1}{ralign 9:{res:{sf:     40.5}}}{space 1}{space 1}{ralign 9:{res:{sf:    64.06}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf: 219.3595}}}{space 1}{space 1}{ralign 9:{res:{sf: 35062.85}}}{space 1}{space 1}{ralign 9:{res:{sf: 187.2508}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.341896}}}{space 1}{space 1}{ralign 9:{res:{sf: 9.977149}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.42e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:      .01}}}{space 1}{space 1}{ralign 9:{res:{sf:     1431}}}{space 1}{space 1}{ralign 9:{res:{sf:    11.89}}}{space 1}{space 1}{ralign 9:{res:{sf:     40.5}}}{space 1}{space 1}{ralign 9:{res:{sf:    64.06}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf:  196.851}}}{space 1}{space 1}{ralign 9:{res:{sf: 19376.63}}}{space 1}{space 1}{ralign 9:{res:{sf: 139.1999}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.154594}}}{space 1}{space 1}{ralign 9:{res:{sf: 8.012006}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.17e+07}}}{space 1}{space 1}{ralign 9:{res:{sf:        1}}}{space 1}{space 1}{ralign 9:{res:{sf:      910}}}{space 1}{space 1}{ralign 9:{res:{sf:       40}}}{space 1}{space 1}{ralign 9:{res:{sf:       77}}}{space 1}{space 1}{ralign 9:{res:{sf:      110}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf:   110344}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.112131}}}{space 1}{space 1}{ralign 9:{res:{sf: .2153464}}}{space 1}{space 1}{ralign 9:{res:{sf: .4640543}}}{space 1}{space 1}{ralign 9:{res:{sf:  .131062}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.699643}}}{space 1}{space 1}{ralign 9:{res:{sf:   122717}}}{space 1}{space 1}{ralign 9:{res:{sf: .0000769}}}{space 1}{space 1}{ralign 9:{res:{sf: 2.474485}}}{space 1}{space 1}{ralign 9:{res:{sf:    .1192}}}{space 1}{space 1}{ralign 9:{res:{sf: .3541667}}}{space 1}{space 1}{ralign 9:{res:{sf: .5093443}}}{space 1}

{space 0}{space 0}{ralign 12:}{space 1}{c |}{space 1}{ralign 9:e(p25)}{space 1}{space 1}{ralign 9:e(p50)}{space 1}{space 1}{ralign 9:e(p75)}{space 1}{space 1}{ralign 9:e(p90)}{space 1}{space 1}{ralign 9:e(p95)}{space 1}{space 1}{ralign 9:e(p99)}{space 1}
{space 0}{hline 13}{c   +}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}{hline 11}
{space 0}{space 0}{ralign 12:af_used}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      110}}}{space 1}{space 1}{ralign 9:{res:{sf:      166}}}{space 1}{space 1}{ralign 9:{res:{sf:      254}}}{space 1}{space 1}{ralign 9:{res:{sf:      452}}}{space 1}{space 1}{ralign 9:{res:{sf:   608.49}}}{space 1}{space 1}{ralign 9:{res:{sf:      970}}}{space 1}
{space 0}{space 0}{ralign 12:af_used_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      110}}}{space 1}{space 1}{ralign 9:{res:{sf:      166}}}{space 1}{space 1}{ralign 9:{res:{sf:      254}}}{space 1}{space 1}{ralign 9:{res:{sf:      452}}}{space 1}{space 1}{ralign 9:{res:{sf:   608.49}}}{space 1}{space 1}{ralign 9:{res:{sf:      970}}}{space 1}
{space 0}{space 0}{ralign 12:acres_irr}{space 1}{c |}{space 1}{ralign 9:{res:{sf:      122}}}{space 1}{space 1}{ralign 9:{res:{sf:      130}}}{space 1}{space 1}{ralign 9:{res:{sf:      242}}}{space 1}{space 1}{ralign 9:{res:{sf:      375}}}{space 1}{space 1}{ralign 9:{res:{sf:      500}}}{space 1}{space 1}{ralign 9:{res:{sf:      740}}}{space 1}
{space 0}{space 0}{ralign 12:depth_appl~d}{space 1}{c |}{space 1}{ralign 9:{res:{sf:     .784}}}{space 1}{space 1}{ralign 9:{res:{sf:    1.104}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.425461}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.725806}}}{space 1}{space 1}{ralign 9:{res:{sf: 1.918519}}}{space 1}{space 1}{ralign 9:{res:{sf:  2.20625}}}{space 1}

{com}.         esttab . using "$dr_output_main/table1_wrg_lepa_sum_stats.rtf" , cells("mean(fmt(%9.2fc)) p50(fmt(%9.2fc)) sd min max") title("Table 1: LEPA Summary Statistics") nomtitles label replace wide 
{res}{txt}(output written to {browse  `"C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/table1_wrg_lepa_sum_stats.rtf"'})

{com}.         restore 
{txt}
{com}. 
. ********************************************************************************
. ********************************** Figure 1 ************************************
. ********************************************************************************        
. use "$dr_temp\wrg_collapsed.dta", replace
{txt}
{com}.                 xtset WR_GROUP wua_year
{res}
{col 1}{txt:Panel variable: }{res:WR_GROUP}{txt: (unbalanced)}
{p 1 16 2}{txt:Time variable: }{res:wua_year}{txt:, }{res:{bind:1991}}{txt: to }{res:{bind:2019}}{txt:, but with gaps}{p_end}
{txt}{col 10}Delta: {res}1 unit
{txt}
{com}.                 keep if wua_year>1991
{txt}(16,559 observations deleted)

{com}.         /* Address missing and extreme values */
.                 *Drop wr_groups who don't have predevelopment characteristics
.                 keep if !missing(sy)
{txt}(68,223 observations deleted)

{com}.                 keep if !missing(predev_sat)
{txt}(0 observations deleted)

{com}.                 keep if !missing(predev_dtw)
{txt}(0 observations deleted)

{com}.                 keep if !missing(hyd_cond)
{txt}(0 observations deleted)

{com}.                 *Drop wr_groups if they have missing precip or soil data
.                 drop if missing(jan_april_mean_ppt)
{txt}(0 observations deleted)

{com}.                 drop if missing(awc)
{txt}(853 observations deleted)

{com}.                 *Drop wr_groups if they have missing authorized quantities or acreage
.                 drop if missing(wrg_authquant_IRR_umw) | missing(wrg_authquant_all_umw) | missing(wrg_auth_irr_acres)
{txt}(7,960 observations deleted)

{com}.                 *Drop observations with recorded withdrawals but no irrigated acres and vice-versa
.                 drop if af_used_irr>0 & acres_irr==0
{txt}(495 observations deleted)

{com}.                 drop if acres_irr>0 & af_used_irr==0
{txt}(0 observations deleted)

{com}.                 *Create a irrigation intensity outcome variable
.                 bysort WR_GROUP wua_year: gen depth_applied = af_used_irr/acres_irr
{txt}(5,198 missing values generated)

{com}.                 *Drop extreme values for af_used, acres_irr 
.                         sum af_used, d

                        {txt}(sum) af_used
{hline 61}
      Percentiles      Smallest
 1%    {res}        0              0
{txt} 5%    {res}    19.75              0
{txt}10%    {res}    44.16              0       {txt}Obs         {res}    350,588
{txt}25%    {res}   95.415              0       {txt}Sum of wgt. {res}    350,588

{txt}50%    {res}    159.5                      {txt}Mean          {res} 240.2627
                        {txt}Largest       Std. dev.     {res} 358.0513
{txt}75%    {res}      261       15725.45
{txt}90%    {res}   494.24       16005.28       {txt}Variance      {res} 128200.7
{txt}95%    {res}   718.44       16191.03       {txt}Skewness      {res} 13.34168
{txt}99%    {res}     1403        18592.3       {txt}Kurtosis      {res} 377.3939
{txt}
{com}.                                 drop if af_used >= r(p99) & af_used < .
{txt}(3,506 observations deleted)

{com}.                         sum acres_irr, d

                       {txt}(sum) acres_irr
{hline 61}
      Percentiles      Smallest
 1%    {res}        0              0
{txt} 5%    {res}       42              0
{txt}10%    {res}       75              0       {txt}Obs         {res}    347,082
{txt}25%    {res}      120              0       {txt}Sum of wgt. {res}    347,082

{txt}50%    {res}      130                      {txt}Mean          {res} 197.8338
                        {txt}Largest       Std. dev.     {res} 175.7703
{txt}75%    {res}      240           3540
{txt}90%    {res}      390           3780       {txt}Variance      {res} 30895.18
{txt}95%    {res}      522           4000       {txt}Skewness      {res} 3.468142
{txt}99%    {res}      910           5120       {txt}Kurtosis      {res} 25.55416
{txt}
{com}.                                 drop if acres_irr >= r(p99) & acres_irr < .
{txt}(3,527 observations deleted)

{com}.                         sum depth_applied, d

                        {txt}depth_applied
{hline 61}
      Percentiles      Smallest
 1%    {res} .0995851        .000069
{txt} 5%    {res} .3083333       .0000769
{txt}10%    {res} .4666667         .00008       {txt}Obs         {res}    338,357
{txt}25%    {res} .7506703       .0000833       {txt}Sum of wgt. {res}    338,357

{txt}50%    {res} 1.085837                      {txt}Mean          {res} 1.111019
                        {txt}Largest       Std. dev.     {res} .5234444
{txt}75%    {res} 1.434167          16.57
{txt}90%    {res}    1.776         17.415       {txt}Variance      {res} .2739941
{txt}95%    {res}  1.98375          27.87       {txt}Skewness      {res} 1.875069
{txt}99%    {res} 2.428676          29.83       {txt}Kurtosis      {res} 62.16191
{txt}
{com}.                                 drop if depth_applied >= r(p99) & depth_applied < .             
{txt}(3,384 observations deleted)

{com}. 
.                 /* Label variables */
.                         label var wua_year "Year"
{txt}
{com}.                         label var af_used "Acre-feet applied"
{txt}
{com}.                         label var acres_irr "Irrigated acres"
{txt}
{com}.                         label var depth_applied "Depth applied - acre-feet applied per acre"
{txt}
{com}.                         label var awc "Available water capacity"
{txt}
{com}.                         label var sandtotal "Sand content (%)"
{txt}
{com}.                         label var silttotal "Silt content (%)"
{txt}
{com}.                         label var slope "Slope"
{txt}
{com}.                         label var jan_april_mean_ppt "Preseason precipitation (mm)"
{txt}
{com}.                         label var may_sep_mean_ppt "Growing season precipitation (mm)"
{txt}
{com}.                         label var jan_april_mean_ET0_elev "Preseason evapotranspiration, using elevation from ssurgo"
{txt}
{com}.                         label var may_sep_mean_ET0_elev "Growing season evapotranspiration, using elevation from ssurgo"
{txt}
{com}.                         label var jan_april_mean_ET0_Har "Preseason evapotranspiration"
{txt}
{com}.                         label var may_sep_mean_ET0_Har "Growing season evapotranspiration"
{txt}
{com}. 
. *Recreate type_system variable
. gen type_system = . 
{txt}(340,171 missing values generated)

{com}. forvalues i=1(1)4 {c -(}
{txt}  2{com}.         replace type_system = `i' if type_system_`i'>0 & !missing(type_system_`i')
{txt}  3{com}. {c )-}
{txt}(48,242 real changes made)
(2,718 real changes made)
(75,418 real changes made)
(194,387 real changes made)

{com}. drop if type_system==2
{txt}(2,225 observations deleted)

{com}. 
. *Collapse
. collapse (mean) af_used_irr acres_irr depth_applied, by(type_system wua_year)
{res}{txt}
{com}. 
. *Af_used_irr
. tw (line af_used_irr wua_year if type_system==1, lcolor(navy%100) lpattern(dot) lwidth(1.2)) ///
>         (line af_used_irr wua_year if type_system==3, lcolor(magenta%100) lpattern(dash)) ///
>         (line af_used_irr wua_year if type_system==4, lcolor(dkorange%100) lpattern(l)), ///
>                 title("Mean acre-feet withdrawn", size(small)) ///
>                 xscale(range(1991 2019)) xlabel(1991(3)2019, labsize(vsmall) nogrid) ///
>                 xtitle("Year", size(vsmall)) ///
>                 yscale(range(50 300)) ylabel(50(50)300, nogrid) ///
>                 ytitle("Acre-feet", size(small)) ///
>                 legend(rows(1) order(1 2 3) ///
>                 label(1 "Flood irrigation") /// 
>                 label(2 "Traditional center pivot irrigation") ///
>                 label(3 "LEPA irrigation") ///
>                 cols(1) size(tiny)) ///
>                         graphregion(color(white)) name(af_used, replace)
{res}{txt}
{com}.                 
. *Acres_irr
. tw (line acres_irr wua_year if type_system==1, lcolor(navy%100) lpattern(dot) lwidth(1.2)) ///
>         (line acres_irr wua_year if type_system==3, lcolor(magenta%100) lpattern(dash)) ///
>         (line acres_irr wua_year if type_system==4, lcolor(dkorange%100) lpattern(l)), ///
>                 title("Mean acres irrigated", size(small)) ///
>                 xscale(range(1991 2019)) xlabel(1991(3)2019, labsize(vsmall) nogrid) ///
>                 yscale(range(50 250)) ylabel(50(50)250, nogrid) ///
>                 xtitle("Year", size(small)) ///
>                 ytitle("Acres", size(small)) ///
>                 legend(off) ///
>                         graphregion(color(white)) name(acres_irr, replace)
{res}{txt}
{com}.                 
. *Depth_applied
. tw (line depth_applied wua_year if type_system==1, lcolor(navy%100) lpattern(dot) lwidth(1.2)) ///
>         (line depth_applied wua_year if type_system==3, lcolor(magenta%100) lpattern(dash)) ///
>         (line depth_applied wua_year if type_system==4, lcolor(dkorange%100) lpattern(l)), ///
>                 title("Mean depth applied", size(small)) ///
>                 xscale(range(1991 2019)) xlabel(1991(3)2019, labsize(vsmall) nogrid) ///
>                 yscale(range(.75 1.5)) ylabel(.75(.25)1.5, nogrid) ///
>                 xtitle("Year", size(small)) ///
>                 ytitle("Feet", size(small)) ///
>                 legend(off) ///
>                         graphregion(color(white)) name(depth_applied, replace)
{res}{txt}
{com}. 
. /* Combine the graphs */
. grc1leg2 af_used acres_irr depth_applied, ///
>         rows(3) cols(1) legendfrom(af_used) xtob1title xtitlefrom(af_used) ///
>         labsize(vsmall) lmsize(tiny) graphregion(color(white)) xsize(6.49) ysize(7.99)
{txt}-grc1leg2- working...
{res}{txt}
{com}.         *Stop, run graph editor, and move "Year" label for x axis above the legend
. graph export "$dr_output_main/figure1.tif", replace wid(6500) height(7990)
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/figure1.tif{rm}
saved as
TIFF
format
{p_end}

{com}. 
. ********************************************************************************
. ********************************** Figure 2 *************************************
. ********************************************************************************        
. /* Load in the data collapsed to the WR_GROUP level*/
.         use "$dr_temp\wrg_collapsed.dta", replace
{txt}
{com}.         *Install cleanplots package
.         net install cleanplots, from("https://tdmize.github.io/data/cleanplots") 
checking {hilite:cleanplots} consistency and verifying not already installed...
all files already exist and are up to date.
{txt}
{com}.         set scheme cleanplots, perm
{txt}({cmd:set scheme} preference recorded)

{com}. 
. *Process data
.         collapse (sum) flood_acres cp_acres lepa_acres acres_irr, by(wua_year)
{res}{txt}
{com}.         gen other_acres = acres_irr - flood_acres - cp_acres - lepa_acres
{txt}
{com}.         drop acres_irr
{txt}
{com}.         foreach var of varlist flood_acres cp_acres lepa_acres other_acres {c -(}
{txt}  2{com}.                 gen share_`var' = 100*`var'/(flood_acres+cp_acres+lepa_acres+other_acres)
{txt}  3{com}.         {c )-}
{txt}
{com}.         rename (flood_acres cp_acres lepa_acres other_acres share_flood_acres share_cp_acres share_lepa_acres share_other_acres) ///
>                 (acres1 acres2 acres3 acres4 share_acres1 share_acres2 share_acres3 share_acres4)
{res}{txt}
{com}.         reshape long acres share_acres, i(wua_year) j(tech)
{txt}(j = 1 2 3 4)

Data{col 36}Wide{col 43}->{col 48}Long
{hline 77}
Number of observations     {res}          29   {txt}->   {res}116         
{txt}Number of variables        {res}           9   {txt}->   {res}4           
{txt}j variable (4 values)                     ->   {res}tech
{txt}xij variables:
               {res}acres1 acres2 ... acres4   {txt}->   {res}acres
share_acres1 share_acres2 ... share_acres4{txt}->   {res}share_acres
{txt}{hline 77}

{com}. 
.         gen tech_name = "Flood"
{txt}
{com}.         replace tech_name = "Traditional center pivot" if tech==2
{txt}variable {bf}{res}tech_name{sf}{txt} was {bf}{res}str5{sf}{txt} now {bf}{res}str24{sf}
{txt}(29 real changes made)

{com}.         replace tech_name = "LEPA" if tech==3
{txt}(29 real changes made)

{com}.         replace tech_name = "Other system" if tech==4
{txt}(29 real changes made)

{com}. 
.         label define tech_codes 1 "Flood" 2 " Traditional center pivot" 3 "LEPA" 4 "Other system"
{txt}
{com}.         label values tech tech_codes
{txt}
{com}. 
. *Xtset and graph
.         xtset tech wua_year
{res}
{col 1}{txt:Panel variable: }{res:tech}{txt: (strongly balanced)}
{p 1 16 2}{txt:Time variable: }{res:wua_year}{txt:, }{res:{bind:1991}}{txt: to }{res:{bind:2019}}{p_end}
{txt}{col 10}Delta: {res}1 unit
{txt}
{com}.                 xtline acres, overlay
{res}{txt}
{com}.                         
.         *Stack the data 
.         gen stack_acres  = .   // generate empty variables
{txt}(116 missing values generated)

{com}.         gen stack_share_acres = .
{txt}(116 missing values generated)

{com}.         sort wua_year tech  // it is import to sort the data here.
{txt}
{com}.         levelsof wua_year, local(years) 
{res}{txt}1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019

{com}.                 foreach y of local years {c -(}
{txt}  2{com}.                 summ tech
{txt}  3{com}.                 // take the first tech as it is
.                 replace stack_acres = acres if wua_year==`y' & tech==`r(min)'
{txt}  4{com}.                 // iteratively add up the 
.                 replace stack_acres = acres + stack_acres[_n-1]  if  wua_year==`y' & tech!=`r(min)'  
{txt}  5{com}.                   
.                 * stack shares  
.                 replace stack_share_acres = share_acres if  wua_year==`y' & tech==`r(min)' 
{txt}  6{com}.                 replace stack_share_acres = share_acres + stack_share_acres[_n-1] if  wua_year==`y' & tech!=`r(min)'
{txt}  7{com}.         {c )-}

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}(1 real change made)
(3 real changes made)
(1 real change made)
(3 real changes made)

{com}. 
. *Graph stacked share of acres
.         xtline stack_share_acres, overlay 
{res}{txt}
{com}. 
. *Now fill in the regions and fancy graph 
. **** get the labels in order
.         summ wua_year 

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}wua_year {c |}{res}        116        2005    8.402898       1991       2019
{txt}
{com}.         gen tag = 1 if wua_year==`r(max)'
{txt}(112 missing values generated)

{com}.         sort wua_year tech
{txt}
{com}.         *Generate rank variable 
. 
.                 *Reverse ordering 
.                 sort wua_year tech
{txt}
{com}.                 summ tech  

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}tech {c |}{res}        116         2.5    1.122884          1          4
{txt}
{com}.                 gen tech2 = `r(max)' + 1 - tech  // reverse the ordering
{txt}
{com}.         sort wua_year tech
{txt}
{com}.         gen labely = .
{txt}(116 missing values generated)

{com}.          replace labely =  stack_share_acres / 2           if tech==1 & tag==1
{txt}(1 real change made)

{com}.          replace labely = (stack_share_acres + stack_share_acres[_n-1]) / 2  if tech!=1 & tag==1
{txt}(3 real changes made)

{com}.         egen rank = rank(share_acres)   if tag==1 & share_acres > 0 & share_acres!=., f 
{txt}(112 missing values generated)

{com}.          
.         format share_acres %9.1f
{txt}
{com}.         gen labelval = tech_name + " (" + string(share_acres, "%9.1fc") + "%)"   if rank <= 10
{txt}(112 missing values generated)

{com}.         levelsof tech2, local(levels)
{res}{txt}1 2 3 4

{com}.         local items = `r(r)'
{txt}
{com}.          
.         foreach x of local levels {c -(}
{txt}  2{com}.         display "`x'"
{txt}  3{com}.         local x2 = `x' + 2
{txt}  4{com}.         display "`x2'"
{txt}  5{com}.         colorpalette mrc, n(7) nograph
{txt}  6{com}.          local stacklines2 `stacklines2' area stack_share_acres wua_year if tech2 == `x', fcolor("`r(p`x2')'") lcolor(black) lwidth(*0.2) ||
{txt}  7{com}.          {c )-}
1
3
{res}2
4
3
5
4
6
{txt}
{com}.         summ wua_year 

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}wua_year {c |}{res}        116        2005    8.402898       1991       2019
{txt}
{com}.         local x1 = `r(min)'
{txt}
{com}.         local x2 = `r(max)'
{txt}
{com}.         summ wua_year

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}wua_year {c |}{res}        116        2005    8.402898       1991       2019
{txt}
{com}.         summ acres if wua_year==`r(max)'

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 7}acres {c |}{res}          4      731401     1115344      50457    2396287
{txt}
{com}.           local ctot = `r(sum)'
{txt}
{com}.           local ctot : di %7.0fc `ctot'
{res}{txt}
{com}.   
. *Graph
. graph twoway `stacklines2' ///
>  (scatter labely wua_year if tag==1, ms(smcircle) msize(0.2) mcolor(black%20) mlabel(labelval) mlabsize(small) mlabcolor(black) ) ///
>  , ///
>   legend(off) ///
>   ytitle("Percent of irrigated acreage", size(small)) ///
>   ylabel(, labsize(small) nogrid) ///
>   xtitle("") ///
>   xlabel(`x1'(1)`x2', labsize(small) angle(vertical) nogrid) ///
>   xscale(range(1991 2025)) ///
>   title("Share of irrigated acreage by system") ///
>   graphregion(margin(0 1 .5 .5))
{res}{txt}
{com}. graph export "$dr_output_main/figure2.tif", replace wid(6500) height(3100)
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text/figure2.tif{rm}
saved as
TIFF
format
{p_end}

{com}. 
. *Close log
.         log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\logs\descriptive_stats_plots.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}19 May 2024, 20:21:55
{txt}{.-}
{smcl}
{txt}{sf}{ul off}